	_arry = _this;
	_heloname = _arry select 0;
	_helo = _arry select 0;
	_callsign = _arry select 1;
	_home = _arry select 2;
	_airport = _arry select 3;
	_egress = _arry select 4;
	_ingress = _arry select 5;
	_option1 = if (count _this > 6) then {_this select 6};
	_option2 = if (count _this > 7) then {_this select 7};
	_option3 = if (count _this > 8) then {_this select 8};
	_option4 = if (count _this > 9) then {_this select 9};
	_class = typeof _helo;
	
if(_helo getVariable "RUM_inFlight")exitwith{hint "Helo in flight";};
if((_helo iskindof "Plane")&&(_class != "MV22"))then{_helo setfuel 0};

//////////////////////////////// Start of Map section //////////////////////////////////

	RUM_ASclick = false;

	openMap [true,true];
for [{_n=1},{_n<=3},{_n=_n+1}] do {
	_mkrname = "";
	_type = "";
	_hint = "";
	switch (_n) do {
		case 1: {
			_mkrname = format ["%1target",_helo];
			_type = "mil_pickup";
			_hint = "Select Drop-Off LZ";
		};
		case 2: {
			_mkrname = format ["%1ingress",_helo];
			_type = "mil_start";
			_hint = "Select Drop-Off LZ Ingress Point";
		};
		case 3: {
			_mkrname = format ["%1egress",_helo];
			_type = "mil_end";
			_hint = "Select Drop-Off LZ Egress Point";
		};
		default {
			hint "shit";	
		};
	};
	_asloc = createMarkerLocal [_mkrname, [0,0,0]];
	_asloc setMarkerShapeLocal "ICON";
	_mkrname setMarkerTypeLocal _type;
	_stgtar = format ["'%1' setMarkerPosLocal _pos;RUM_ASclick = true",_mkrname];
	onMapSingleClick _stgtar;
	cutText [_hint, "PLAIN DOWN"];
	waitUntil {RUM_ASclick};
	
	if((_n == 2) or (_n == 3)) then {
		_mkrname2 = format ["%1target",_helo];
		_mkrname setMarkerDirLocal ((getMarkerPos _mkrname2 select 0)-(getMarkerPos _mkrname select 0)) atan2 ((getMarkerPos _mkrname2 select 1)-(getMarkerPos _mkrname select 1));
	};
	
	onMapSingleClick "";
	RUM_ASclick = false;
	
};

	titleFadeOut 0;
	sleep 1;
	openMap [false,false];

//////////////////////////////////// End of Map section //////////////////////////////////
//////////////////////////////////// Start of Helo Setup //////////////////////////////////

	_helo setVariable ["RUM_inFlight", true, true];

// delete and replace the static helo - client side
	_heloNewName = str(_heloname);

// grabs the position of the helo prior to being deleted so it can be repositioned at the same place on an LHD
	_heliPosASL = [getposASL _helo select 0, getposASL _helo select 1,(getposASL _helo select 2)*0 + 17.5];

	deleteVehicle _heloname;
	_spwndir = getdir _home;

// create vehicle client side
	_helo = createVehicle [_class, getPos _home, [], 0, "NONE"];
	_helo setVehicleVarName _heloNewName;

	
// checks to see if the helo is either over water or on land and place accordingly
	if (surfaceIsWater (getpos _home)) then {
		// player sidechat format["Heli is on LHD or Ship, %1",_heliRoute];
		_helo setposASL _heliPosASL;
	}else{
		// player sidechat format["Heli is not over water, %1",_heliRoute];
		_helo setpos getpos _home;
	};
	
	_helo setdir _spwndir;
	
	_num = count _this;
	player sidechat format["%1",_num];
	if(_num >= 6)then{
		if(_num == 7)then{
			_arry = [_helo,_callsign,_home,_airport,_egress,_ingress, _option1];
		};
		if(_num == 8)then{
			_arry = [_helo,_callsign,_home,_airport,_egress,_ingress, _option1,_option2];
		};
		if(_num == 9)then{
			_arry = [_helo,_callsign,_home,_airport,_egress,_ingress, _option1,_option2,_option3];
		};
		if(_num == 10)then{
			_arry = [_helo,_callsign,_home,_airport,_egress,_ingress, _option1,_option2,_option3,_option4];
		};
	}else{
		_arry = [_helo,_callsign,_home,_airport,_egress,_ingress];
	};

// create units to fly helo - client side
	sleep 3;
	_crew = [];
	_grp = createGroup side player;
	_pilot = _grp createUnit [RUM_THEL_Pilot, getpos _home, [], 0, "FORM"];
	_helo lockDriver false;
	_pilot moveinDriver _helo;
	_helo lockDriver true;
	_crew = _crew + [_pilot];
	_grp2 = createGroup side player;
	_cfg=configFile >> "CfgVehicles" >> typeof _helo >> "turrets";

// if (surfaceIsWater (getpos _home)) then {

	for [{_n=0},{_n<count _cfg},{_n=_n+1}] do {
		_gunner = _grp2 createUnit [RUM_THEL_Pilot, getpos _home, [], 0, "FORM"];
		_helo lockTurret [[_n], false];
		_gunner moveinTurret [_helo,[_n]];
		_helo lockTurret [[(_n-1)], true];
		if!(_gunner in crew _helo)then{deleteVehicle _gunner};
		_crew = _crew + [_gunner];
	};
// };
	_grp2 setCombatMode "RED";
	_grp2 setBehaviour "COMBAT";

	// player sidechat format["after helo creation!!! - %1",_arry];
	
//////////////////////////////////// End of Helo Setup //////////////////////////////////
// [] spawn;
	// WaitUntil {!alive _unit};
// sleep 0.5;
// deleteVehicle _Source;
// };

_varOM = false;

if(_helo iskindof "Plane")then{_helo FlyInHeight RUM_THEL_flyHeightPLN}else{_helo FlyInHeight RUM_THEL_flyHeight};

["insert",[player,_pilot,_callsign]] execVM (RUM_PATH+"Transport\radiodialogs.sqf");
sleep 10;

//
_helo engineOn true;  call RUM_THel_VehicleOptions;

	_stg = format ["%1 : Move On!",_callsign];
	_stg2 = format ["%1 : Abort, RTB!",_callsign];
	
if (alive _helo) then {
	RUM_THel_actionid = player addAction [_stg, (RUM_PATH+"Transport\om.sqf"),[_helo,_callsign]];
	RUM_THel_actionid2 = _helo addAction [_stg, (RUM_PATH+"Transport\om.sqf"),[_helo,_callsign],1,false,true,"","_this in _target"];
	// RUM_THel_actionid3 = player addAction [_stg2, (RUM_PATH+"Transport\abort.sqf"),[_arry]];
};
sleep 3;

_helo setVariable ["RUM_THel_continue",false,true];
waitUntil {(!alive _helo) or (_helo getVariable "RUM_THel_continue")};
if(_helo iskindof "Plane")then{_helo setfuel 1};

// if(RUM_THel_Special == "Para Drop")then{_helo FlyInHeight RUM_THEL_flyHeightPara};
// if(RUM_THel_Special == "HALO Jump")then{_helo FlyInHeight RUM_THEL_flyHeightHALO};

for [{_n=1},{_n<=3},{_n=_n+1}] do {
	_mkrname = "";
	switch (_n) do {
		case 1: {
			if(RUM_THel_Special == "Para Drop" or RUM_THel_Special == "HALO Jump" or RUM_THel_Special == "Combat Landing")then{
				// player globalchat "special";
				[_mkrname,_grp,_egress] call RUM_THel_movewaypoint;
			}else{
				// player globalchat "not special";
				[_mkrname,_grp,_egress] call RUM_THel_moveWPTakeoff; [_mkrname,_grp,_egress] call RUM_THel_moveWPNormal;
			};
		};
		case 2: {
			_mkrname = format ["%1ingress",_helo];
			[_mkrname,_grp] call RUM_THel_movewaypoint;
		};
		case 3: {
			_mkrname = format ["%1target",_helo];
			[_mkrname,_grp,_helo] call RUM_THel_landwaypoint;
			// if (_class == "MV22") then {
				// sleep 45;
			// };
			call RUM_THel_VehicleOptions;
		};
	};
};
		
_cont = format ["%1",_helo];
RUM_THel_land = "";
waitUntil {(!alive _helo) or (RUM_THel_land == _cont)};

switch (RUM_THel_Special) do {
	case "Normal":{
		_helo land "get out";
		_stg = format ["%1 : Move On!",_callsign];
	
		if (alive _helo) then {
			RUM_THel_actionid = player addAction [_stg, (RUM_PATH+"Transport\om.sqf"),[_helo,_callsign]];
			RUM_THel_actionid2 = _helo addAction [_stg, (RUM_PATH+"Transport\om.sqf"),[_helo,_callsign],1,false,true,"","_this in _target"];
		};
	};
	case "Combat Landing":{
		_crew = crew _helo;
		_cargo = ((_crew - units _grp) - units _grp2);
		[_cargo,_helo,false] execVM (RUM_PATH+"Transport\combat_insertion.sqf");
	};
	case "Fast Rope":{
		// Norrin Fastrope addon required
		// hint "NORRIN";
		_helo FlyInHeight 35;
		[_helo, 0, 60, ""] execVM (RUM_PATH+"Transport\fastrope\NORRN_fastRope_init.sqf");
		// RUM_THel_actionid3 = player addAction [_stg2, (RUM_PATH+"Transport\abort.sqf"),[_arry]];
	};
	case "Para Drop":{
		_crew = crew _helo;
		_cargo = ((_crew - units _grp) - units _grp2);
		{unassignvehicle _x;_x action ["EJECT",_helo];sleep 0.25;} forEach _cargo;
		_helo spawn {sleep 1;_this setVariable ["RUM_THel_continue",true,true]};
	};
	case "HALO Jump":{
		_crew = crew _plane;
		_cargo = ((_crew - units _grp) - units _grp2);
		_plane spawn {sleep 1;_this setVariable ["RUM_THel_continue",true,true]};
		cutText ["This is the Drop Zone!","PLAIN",2];
	};	
	default{hint "shit"};
};

_helo setVariable ["RUM_THel_continue",false,true];
waitUntil {(!alive _helo) or (_helo getVariable "RUM_THel_continue")};
if(RUM_THEL_invisibleH)then{deleteVehicle _lz};
// if(_helo iskindof "Plane")then{_helo FlyInHeight RUM_THEL_flyHeightPLN}else{_helo FlyInHeight RUM_THEL_flyHeight};

for [{_n=1},{_n<=3},{_n=_n+1}] do {
	_mkrname = "";	
	switch (_n) do {	
		case 1: {
				_mkrname = format ["%1egress",_helo];
			if(RUM_THel_Special == "Para Drop" or RUM_THel_Special == "HALO Jump" or RUM_THel_Special == "Combat Landing")then{
				[_mkrname,_grp] call RUM_THel_movewaypoint
			}else{
				[_mkrname,_grp] call RUM_THel_moveWPLZDustOff; [_mkrname,_grp] call RUM_THel_moveWPLZDustOffNormal;
			};
		};
		case 2: {
			[_mkrname,_grp,_ingress] call RUM_THel_movewaypoint;
		};
		case 3: {
			[_mkrname,_grp,_home] call RUM_THel_LandHome;
		};
	};
};

	// player sidechat format[ "before wait: %1, String: %2",RUM_THel_endflight, _stg];
	_end = format ["%1",_helo];
	sleep 5;
	waitUntil{(!alive _helo) or (RUM_THel_endflight == _end)};
	// player sidechat format[ "before wait: %1, %2 ",alive _helo,count(crew _helo)];

	// crew members will exit vehicle
	{unassignVehicle _x;_x action ["GETOUT",_helo];} forEach units _grp2;
	// wait till player(s) have exited the vehicle
	// player sidechat "Exit the vehicle";
	sleep 10;
	
	waitUntil{(!alive _helo) OR (count(crew _helo) == 0)};

// check to make sure the vehicle is alive and that it has no crew members still mounted
if ((alive _helo) and (count(crew _helo) == 0)) then {
	sleep 1;
	// delete all crew members
	{deleteVehicle _x} forEach _crew;
	// give the helo time to settle before it is repositioned and refitted.
	sleep 15;
	_helo setposASL getposASL _home;
	_helo setdir getdir _home;
	_helo setDamage 0;
	_helo setFuel 1;
	_mags = getArray (configFile>>"cfgVehicles">>typeOf _helo>>"Turrets">>"MainTurret">>"magazines");
	{_helo removeMagazine _x} forEach magazines _helo;
	{_helo addMagazine _x} forEach _mags;
};

	// delete all the markers that were created for this instance.
	_mkrname1 = format ["%1ingress",_helo];
	_mkrname2 = format ["%1target",_helo];
	_mkrname3 = format ["%1egress",_helo];
	deletemarkerLocal _mkrname1;
	deletemarkerLocal _mkrname2;
	deletemarkerLocal _mkrname3;

	_mkrname4 = format ["%1ingress2",_helo];
	_mkrname5 = format ["%1target2",_helo];
	_mkrname6 = format ["%1egress2",_helo];
	deletemarkerLocal _mkrname4;
	deletemarkerLocal _mkrname5;
	deletemarkerLocal _mkrname6;

	// this will add the vehicle back to the RUM PDA when resupply has finished. (still has an issue with var passed back)
	// player sidechat format["%1",_arry];
	
	sleep RUM_THEL_ReSupTime;

	RUM_THelAircraft = RUM_THelAircraft + [_arry];
	_helo setVariable ["RUM_inFlight", false, true];

if(true)exitwith{};
